﻿/////////////////////////////////////////////////////////////////////////////
//
// AddFileListCtrl.h : header file
//
// CListCtrl을 확장해서 파일을 drag-and-drop 할 수 있는 기능 추가
// column 0: filename
// column 1: path
//
/////////////////////////////////////////////////////////////////////////////

#pragma once

#include "SmallUtilz.h"

/////////////////////////////////////////////////////////////////////////////
// CAddFileListCtrl window

class CAddFileListCtrl : public CListCtrl
{
// Construction
public:
	CAddFileListCtrl();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAddFileListCtrl)
public:
	//}}AFX_VIRTUAL

// Implementation
public:
	bool checkFilename(int type, CString &name, LPCTSTR ext, int &pos, int column);
	CString csGetFirstFilename(LPCTSTR lp);
	bool bIsASCII(LPCTSTR lpFilename);
	void CheckExternalFiles(int iPos);
	void RemoveSelected();
	void InitListCtrl();
	void AddTailFilename(CString csFilename);
	int FindFilename(CString csFilename);
	void SetButtonRemoveAll(CButton *cb);
	virtual ~CAddFileListCtrl();

protected:
	CString ExpandShortcut(CString &inFile);
	CButton *cbRemoveAll;

	// Generated message map functions
protected:
	//{{AFX_MSG(CAddFileListCtrl)
	afx_msg void OnDropFiles(HDROP dropInfo);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult);
	CStringArray csaFileNames;
	void addCSAFilename(LPCTSTR fileName);
	void removeAtCSAFilename(INT_PTR nIndex);
	void removeAllCSAFilename();
	void setAtCSAFilename(INT_PTR nIndex, LPCTSTR fileName);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
